<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{common/header :: header}">
    <title>作业信息</title>
</head>
<body>
<script>
    function reloadPage(){
        location.reload()
    }
    function deleteJob() {
        var r = confirm("确认要删除这条记录吗?")
        if (r == true) {
            document.getElementById("selectedItem").action = "/jobinfo/delete"
            document.selectedItem.submit()
        } else {

        }
    }
    function setVoid() {
        document.getElementById("selectedItem").action = "/jobinfo/setvoid"
        document.selectedItem.submit()
    }
    function updateDate(){
        document.getElementById("selectedItem").action = "/jobinfo/updatedate"
        document.getElementById("hiddenInput").value = prompt("请输入要更新的日期：","yyyymmdd")
        document.selectedItem.submit()
    }

</script>
<input type="button" value="重新加载页面" onclick="reloadPage()">
<a href="javascript:void(0);" onclick="deleteJob()">删除选中作业记录</a>&nbsp;&nbsp;
<a href="javascript:void(0);" onclick="setVoid()">置虚选中作业</a>&nbsp;&nbsp;
<a href="javascript:void(0);" onclick="updateDate()">更新选中作业日期</a>
<p th:if="${!etlJobStatusList.iterator().hasNext()}">目前没有任何作业记录。</p>
<form id="selectedItem" name="selectedItem" action="" method="post">
    <input id="hiddenInput" name="hiddenInput" type="hidden" value="">
    <table border="2">
        <tbody>
        <thead>
        <tr>
            <td>选中</td>
            <td>作业ID</td>
            <td>系统名称</td>
            <td>作业名称</td>
            <td>作业类型</td>
            <td>作业实际启动时间</td>
            <td>作业实际结束时间</td>
            <td>作业运行状态</td>
        </tr>
        </thead>
        <tr th:each="jobHistory:${etlJobStatusList}">
            <td><input id="jobId" type="radio" name="jobId" th:value="${jobHistory.getId()}"></td>
            <td th:text="${jobHistory.getJobid()}"></td>
            <td th:text="${jobHistory.getEtl_system()}"></td>
            <td th:text="${jobHistory.getEtl_job()}"></td>
            <td th:text="${jobHistory.getType()}"></td>
            <td th:text="${jobHistory.getStarttime()}"></td>
            <td th:text="${jobHistory.getEndtime()}"></td>
            <td th:text="${jobHistory.getJobstatus()}"></td>
        </tr>
        </tbody>
    </table>
</form>
<div th:replace="~{common/footer :: footer}"></div>
</body>
</html>
